package com.ph.spenum;

import org.apache.commons.lang3.StringUtils;

public enum PromptEnum {

	SETUP_PAYPWD("1","支付密码设置成功"),
	UPDATE_LOGINPWD("2","登录密码修改成功"),
	UPDATE_PAYPWD("3","支付密码修改成功"),
	UPDATE_PHONE("4","手机号修改成功");
	
	private String code;
	
	private String message;
	
	private PromptEnum(String code,String message){
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	/**
	 * 
	 * @Title: getMessageByCode   
	 * @Description: 获取描述   
	 * @param: @param code
	 * @param: @return      
	 * @return: String      
	 * @throws
	 */
	public static String getMessageByCode(String code) {
		if (StringUtils.isNotBlank(code)) {
			for (PromptEnum en : PromptEnum.values()) {
				if (code.equals(en.getCode())) {
					return en.getMessage();
				}
			}
		}
		return null;
	}
}
